package com.sjz.han.industry.dialogs;

import android.app.Dialog;
import android.content.Context;
import android.os.Bundle;
import android.view.Gravity;
import android.view.View;
import android.view.Window;
import android.widget.TextView;

import com.sjz.han.industry.R;


/**
 * Created by wzl on 2018/05/04.
 * <p>车辆购买对话框
 * 最后更新 2018/05/04
 */
public class NoticeMessgeDialog extends Dialog implements View.OnClickListener {

    private Context context;
    private TextView sybook_send_tv,sybook_cancle_tv;
    private TextView mustapplycar_tv;
    private OnItemClickLicener onItemClickLicener;
    public NoticeMessgeDialog(Context context) {
        super(context, R.style.dialog2);
        this.context = context;
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.dailog_mustapplycar);

        Window dialogWindow = this.getWindow();
        dialogWindow.setGravity(Gravity.CENTER_VERTICAL);
        setCancelable(false);
        setCanceledOnTouchOutside(false);
//        dialogWindow.setWindowAnimations(R.style.send_photo_anim_style);
        mustapplycar_tv=(TextView)findViewById(R.id.mustapplycar_tv);
        sybook_send_tv = (TextView) findViewById(R.id.sybook_send_tv);
        sybook_send_tv.setText("确定");
        sybook_cancle_tv = (TextView) findViewById(R.id.sybook_cancle_tv);
        sybook_send_tv.setOnClickListener(this);
        sybook_cancle_tv.setOnClickListener(this);
    }
    public void setNoticeTv(String str){
        mustapplycar_tv.setText(str);
    }
    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.sybook_send_tv:
                if (onItemClickLicener != null){
                    onItemClickLicener.isSure();
                }
                dismiss();
                break;
            case R.id.sybook_cancle_tv:
                dismiss();
                break;

        }

    }

    public interface OnItemClickLicener {
        void isSure();
    }

    public void setOnItemClickLicener(OnItemClickLicener onItemClickLicener) {
        this.onItemClickLicener = onItemClickLicener;
    }

}
